package com.vidaappv1;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class CreditsLoaded extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_credits_loaded);

		Button accountinfobutton= (Button)findViewById(R.id.button1);
		Button returntoorder = (Button)findViewById(R.id.Button01);
		TextView amountloaded = (TextView)findViewById(R.id.orderState);
		TextView newbalance = (TextView)findViewById(R.id.TextView01);
		
		Bundle b = getIntent().getExtras();
		int topupamount =(Integer) b.get("Top up amount");
		amountloaded.setText("R"+topupamount+" loaded");
		
		int newbalanceint = 50+topupamount;
		newbalance.setText("Your new balance is R"+newbalanceint);
		
		
		accountinfobutton.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				startActivity(new Intent(getApplicationContext(),AccountInfo.class));

			}
		});
		
		returntoorder.setOnClickListener(new View.OnClickListener() {
			
			@Override
			public void onClick(View v) {
				startActivity(new Intent(getApplicationContext(),BigMenu.class));				
			}
		});
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.credits_loaded, menu);
		return true;
	}

}
